<template>
  <div class="">
    <el-form
    :model="loginForm"
    status-icon
    :rules="loginrules"
    ref="loginForm"
    class="demo-ruleForm"
  >
    <el-form-item prop="mobile">
      <el-input
        type="number"
        placeholder="请输入手机号"
        v-model="loginForm.mobile"
        class="input-with-select"
      >
      </el-input>
    </el-form-item>
    <el-form-item prop="SmsVerificationCode">
      <el-input
        placeholder="请输入验证码"
        v-model="loginForm.smsverificationCode"
        class="input-with-select"
      >
        <el-button slot="append" @click="sendcode" :disabled="show">
          <span v-show="!show" class="count"> 发送验证码</span>
          <span v-show="show" class="count">({{ count }}s)</span>
        </el-button>
      </el-input>
    </el-form-item>
  </el-form>
  </div>
</template>

<script>
export default {
    name:"MobileLogin",
  data() {
    var verifmobile=(rule,value,callback)=>{
        if(value=="")
        {

          callback(new Error("请输入手机号"));            
        }
        else
        {callback();}
    };
    var verifvode=(rule,value,callback)=>{
        if(value=="")
        {

          callback(new Error("请输入验证码"));            
        }
        else
        {callback();}
    };
    return {
        loginForm:{
            mobile:"",
            smsverificationCode:""
        },
        loginrules:{
            mobile: [{ validator: verifmobile, trigger: "blur" }],
        smsverificationCode: [
          { validator: verifvode, trigger: "blur" },
        ],   
        },
        timer:null,
        show:false,
        count:0
    },
    
  },
methods:{
        
    }
}
</script>

<style scoped lang="scss">
</style>